{% extends "base.html" %}

{% block title %}{{title}} Contents{% endblock %}

{% block content %}
    {% if contents %}
        <div id="book_cover">
            <div id="contents_actions" class="middle">
                <UL class="menubar">
                    <LI><a href='/edit/{{id}}'>About</a></LI>
                    <LI><a href='/manifest?key={{key}}'>Manifest</a></LI>
                    <LI><a href='/download?key={{key}}'>Download</a></LI>
                </UL>
                <form action="/search" method="GET">
                    <input type="hidden" name="book_filter" value="{{key}}"/>
                    <input type="search" name="q" placeholder="Search">
                    <input type="submit" name="submit" value="Go">
                </form>
            </div>
            <img class="epub_cover" src="/view/{{id}}/{{cover_path}}"/>
        </div>
    {% endif %}
    <div id="book_contents">
        <b>{{title}}</b>
        {% if not contents %}
            <br/>
            This is an unfiltered list of every file within the ePub container.
        {% endif %}
        <OL>
        {% for file in files %}
            {% if contents %}
            <LI><a href='/view/{{id}}/{{file.path}}'>{{file.name}}</a></LI>
            {% else %}
            <LI>{{file.order}} <a href='/view/{{id}}/{{file.path}}'>{{file.path}}</a></LI>
            {% endif %}
        {% endfor %}
        </OL>
    </div>
    <div class="clear"></div>
    <HR/>
    <div id="epub_description">
        {{description}}
    </div>
{% endblock %}